import api from "../../utils/request.js";
import {API1_URL} from '../../utils/baseURL.js'

export const getMeetList = async (params) => {
    const response = await api({
        url: API1_URL + "/meeting",
        method: 'get',
        params
    });
    return response.data;
};

export const getMeetByIdList = async (id) => {
    const response = await api({
        url: API1_URL + `/meeting/${id}`,
        method: 'get',
    });
    return response.data;
};

export const getReserveList = async (params) => {
    const response = await api({
        url: API1_URL + "/booking",
        method: 'get',
        params
    });
    return response.data;
};

export const postReserve = async (data) => {
    const response = await api({
        url: API1_URL + "/booking",
        method: 'post',
        data
    });
    return response.data;
};

export const putReserveCancel = async (id) => {
    const response = await api({
        url: API1_URL + `/booking/cancel/${id}`,
        method: 'put',
    });
    return response.data;
};

export const getUserInfoByIdNo = async () => {
    const response = await api({
        url: API1_URL + '/user/info',
        method: 'get',
    });
    return response.data;
};

export const getUserPasswordCapcha = async (params) => {
    const response = await api({
        url: API1_URL + '/user/update_password/captcha',
        method: 'get',
        params
    });
    return response.data;
};

export const postUserUpdatePassword = async (data) => {
    const response = await api({
        url: API1_URL + '/user/update_password',
        method: 'post',
        data
    });
    return response.data;
};

export const postUserUpdate = async (data) => {
    const response = await api({
        url: API1_URL + '/user/update',
        method: 'post',
        data
    });
    return response.data;
};

export const getMinioPresignedUrl = async (params) => {
    const response = await api({
        url: API1_URL + '/minio/presignedUrl',
        method: 'get',
        params
    });
    return response.data;
};

export const getUserUpdateCapcha = async (params) => {
    const response = await api({
        url: API1_URL + '/user/update/captcha',
        method: 'get',
        params
    });
    return response.data;
};
